import request from './request'

// 药品详情接口参数
export interface DrugDetailParams {
  id: number
}

// 药品详情响应数据
export interface DrugDetailResponse {
  status: string
  message: string
  result: {
    id: number
    name: string
    effect: string
    taboo: string
    shape: string
    packing: string
    component: string
    usage: string
    sideEffects: string
    storage: string
    minMatter: string
    approvalNumber: string
  }
}

/**
 * 查询常见药品详情
 * @param params 药品ID参数
 * @returns Promise<DrugDetailResponse>
 */
export const getDrugDetail = (params: DrugDetailParams) => {
  return request.get<DrugDetailResponse>('/health/share/knowledgeBase/v1/findDrugsKnowledge', {
    params
  }).then(response => response.data)
}
